package com.example.qxfw.ybzz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.qxfw.common.entity.zy.AirpolFcstQx;
import com.example.qxfw.ybzz.mapper.AirpolFcstQxMapper;
import com.example.qxfw.ybzz.service.AirpolFcstQxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AirpolFcstQxServiceImpl implements AirpolFcstQxService {

    @Autowired
    private AirpolFcstQxMapper airpolFcstQxMapper;

    @Override
    public Integer delete(String forecastTime, String strTimeChar, String stationID) {
        LambdaQueryWrapper<AirpolFcstQx> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(AirpolFcstQx::getTimechar,strTimeChar)
                .eq(AirpolFcstQx::getDatechar,forecastTime)
                .eq(AirpolFcstQx::getStationid,stationID);
        Integer rows = airpolFcstQxMapper.delete(queryWrapper);
        return rows;
    }

    @Override
    public Integer save(AirpolFcstQx airpolFcstQx) {
        int rows = airpolFcstQxMapper.insert(airpolFcstQx);
        return rows;
    }
}
